package com.jack.lib.core.utils;

import android.os.Handler;
import android.os.Looper;


/**
 * author : jack(黄冲)
 * e-mail : 907755845@qq.com
 * create : 2019/4/17
 * desc   :
 */
public class ThreadUtils {

    private static Handler sHandler = new Handler(Looper.getMainLooper());

    public static void start(Runnable runnable){
        new Thread(runnable).start();
    }

    public static void postDelay(long delay, Runnable runnable){
        sHandler.postDelayed(runnable, delay);
    }
    public static void post(Runnable runnable){
        postDelay(0, runnable);
    }

    public static void removeCallbacks(Runnable runnable){
        sHandler.removeCallbacks(runnable);
    }
}
